package com.hscm.boss.convert;


import cn.hutool.core.util.StrUtil;
import com.hscm.boss.common.enums.PublicStatus;
import com.hscm.boss.convert.help.CommonFun;
import com.hscm.boss.dao.entity.UserInfo;
import com.hscm.boss.dao.entity.UserPayInfo;
import com.hscm.boss.mvc.model.vo.config.UserPayInfoVo;
import com.hscm.boss.mvc.model.vo.user.MatchUserInfoVo;
import com.hscm.boss.mvc.model.vo.user.UserInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.Named;

import java.util.List;

@Mapper(componentModel = "spring",uses = {CommonFun.class})
public interface UserConvert {

    //有的需要泛型是UserInfoVo的list集合  通过这个方法就能自动调用下面的mapUserInfoVo方法 将每一个UserInfo转为UserInfoVo
    List<UserInfoVo> toListUserInfoVo(List<UserInfo> userInfo);

    List<MatchUserInfoVo> toListMatchUserInfoVo(List<UserInfo> UserInfo);


    List<UserPayInfoVo> toListUserPayInfoVo(List<UserPayInfo> userPayInfo);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "status", target = "status",qualifiedByName = "transPublicStatus")
    })
    UserInfoVo mapUserInfoVo(UserInfo userInfo);



    @Mappings({
    })
    MatchUserInfoVo matchUserInfoVo(UserInfo UserInfo);



}
